Skip to content

Fixed /github-search command failing in some cases#1435

Merged
Zabuzard merged 2 commits intodevelopfrom
bugfix/gh_search_command_not_defer
Mar 12, 2026
Merged

Fixed /github-search command failing in some cases#1435
Zabuzard merged 2 commits intodevelopfrom
bugfix/gh_search_command_not_defer

Conversation

@Zabuzard
Copy link
Member

What looks inoccent in the code reference.findIssue(...) is actually running API queries in the background. So it is not a quick command.

The code apparently overlooked this and did not make use of JDAs event.deferReply().queue(). In many cases this then leads to the action crashing because it takes longer than 3 seconds:

not ack

This fixes the code by properly using deferReply and then responding through the InteractionHook.

While at it, the PR also fixes a bug with the code in the edge case that the configured GitHub repos have no issues yet (or more commonly when a githubApiKey has not been set up yet). In this case the autocompletion code crashed because it was supplying an empty list. This is now fixed by supplying no issues found in that edge case.

@Zabuzard Zabuzard self-assigned this Mar 11, 2026
@Zabuzard Zabuzard requested a review from a team as a code owner March 11, 2026 15:07
@Zabuzard Zabuzard added bug Something isn't working priority: normal labels Mar 11, 2026
@sonarqubecloud
Copy link

@Zabuzard Zabuzard merged commit ddabd5e into develop Mar 12, 2026
11 checks passed
@Zabuzard Zabuzard deleted the bugfix/gh_search_command_not_defer branch March 12, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants